import Vue from 'vue'
import Vuex from 'vuex'

import {
  getConfigInfo
} from "@/common/envConfig.js"

Vue.use(Vuex)
const state = {}
const getters = {
  // 手机系统信息
  systemInfo: () => uni.getSystemInfoSync(),
  // 小程序配置信息
  configInfo: () => getConfigInfo(),
  // 小程序平台 
  platform: (state, getters) => getters.systemInfo.uniPlatform,
  channelType: (state, getters) => {
    return getters.platform == 'mp-weixin' ? '1' : '2'
  }
}
const mutations = {}
const actions = {}
export default new Vuex.Store({
  state,
  mutations,
  getters,
  actions,
})